feat(nuxt)!: Bundle server config into Nitro build - #24094
Conversation
|
bugbot run |
size-limit report 📦
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 830a18a. Configure here.
chargome
left a comment
There was a problem hiding this comment.
Some questions and nits, otherwise this looks good overall!
| consoleSandbox(() => { | ||
| // eslint-disable-next-line no-console | ||
| console.log( | ||
| '[Sentry] The Sentry server SDK is already initialized, skipping a second initialization. The Sentry server config is bundled into the Nitro server build, so a `node --import` preload of the config file is no longer needed and can be removed.', |
There was a problem hiding this comment.
q: Does this correctly work in dev-mode? Just want to double check that we are not spamming the console there
| // Dev relies on runtime injection (no build-time transform), but the dev bundle hoists the ioredis | ||
| // import above the inlined `Sentry.init`, so its instrumented file loads before injection is active | ||
| // and gets no channels (5.10.x has no native ones). mysql requires its file lazily, after init. | ||
| test.skip(process.env.TEST_ENV === 'development', 'ioredis loads before runtime injection is active in dev'); |
There was a problem hiding this comment.
q: With native channels this does work right? so >5.10.x?
| @@ -6,6 +6,11 @@ import { waitForTransaction } from '@sentry-internal/test-utils'; | |||
| // only happens in the production build, so these tests are excluded from the | |||
There was a problem hiding this comment.
l: Stale comment with this change

Previously, the
sentry.server.config.tsfile was emitted in the build output so it can be added with--import. As we don't rely on early-importing anymore (thanks to orchestrion), we don't need this file anymore.Sentry.initruns at startup withoutnode --import. Works on Nitro 2 and 3, prod and dev (hurray)--importcompat: The old file path now gets a shim that just prints "remove this flag". A CI variant runs the whole suite with the shim preloaded to see if the warning is printedinitwins. The bundled init skips with a notice.listenare captured and flushed (first and last plugin slot)autoInjectServerSentrymodes, kept working until v12Closes #24149